home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / tutorials / geometer / Theorems / curves / bigbez.T next >
Encoding:
Text File  |  1994-08-02  |  1.3 KB  |  32 lines

  1. .geometry "version 0.1";
  2. v1 = .free(-0.781122, -0.644323, .invisible, "1");
  3. v2 = .free(0.78933, -0.644323, .invisible, "2");
  4. l1 = .l.vv(v1, v2);
  5. v3 = .vonl(l1, 0.201094, -0.644323, .plus, "Ratio");
  6. v4 = .free(-0.668947, -0.113543, "B1");
  7. v5 = .free(-0.452804, 0.46922, "B2");
  8. v6 = .free(0.269494, 0.471956, "B3");
  9. v7 = .free(0.619699, -0.201094, "B4");
  10. bez = .bez.vvvv(v4, v5, v6, v7, .red);
  11. l2 = .l.vv(v4, v5);
  12. l3 = .l.vv(v5, v6);
  13. l4 = .l.vv(v6, v7);
  14. rat = .ratio.vvv(v1, v3, v2);
  15. v45 = .v.vvratio(v4, v5, rat);
  16. v56 = .v.vvratio(v5, v6, rat);
  17. v67 = .v.vvratio(v6, v7, rat);
  18. l5 = .l.vv(v45, v56);
  19. l6 = .l.vv(v56, v67);
  20. v456 = .v.vvratio(v45, v56, rat);
  21. v567 = .v.vvratio(v56, v67, rat);
  22. l7 = .l.vv(v456, v567);
  23. v4567 = .v.vvratio(v456, v567, rat, .yellow);
  24. .text("This shows how a cubic Bezier curve is defined in terms of its");
  25. .text("control points.  The control points are B1, B2, B3, and B4, and");
  26. .text("all can be moved with the left mouse button.  In addition, all");
  27. .text("the other points on the segments joining the control points, on");
  28. .text("the segments joining them, and so on, are in the same ratio as");
  29. .text("the point on the line at the bottom of the screen.  Move the");
  30. .text("point named 'Ratio' along the line and notice that all the");
  31. .text("ratios change.  The yellow point sweeps along the Bezier curve.");
  32.